function requestNews(){
	var htmlNews = '';
	$.getJSON("http://localhost:61246/api/News", function(data) {
		$.each(data, function(index, value) {
			var originalLink = data[index]["originalLink"];
			var title = data[index]["title"];
			var linkImage = data[index]["linkImage"];
			
			htmlNews += "<div style=\"margin-bottom:10px;min-height: 35px;\"><img style=\"margin-right: 10px;width:50px;position: relative;float: left;\" src=\"" + linkImage + "\">"
				+ "<li style=\"list-style-type:none;\">" 
				+ "<a  target=\"_blank\" style=\"text-decoration:none;\" href=\"" + originalLink + "\">" + title + "</a></li></div>";
			
		});
		
		document.getElementById('list-news').innerHTML = htmlNews;
	}).error(function(jqXHR, textStatus) {
		console.log("Add news failed");
	});
}

$(document).ready(function($){
	requestNews();
});